import express from "express";
import Data from "../MockData/MockDataDynamic.js";

const queryDataListDynamic = express.Router();
let dataRes = [];
function query(){  
    let total = Data.length;
    return {
        list: Data,
        total: total,
    };
}

queryDataListDynamic.get("/dataListDynamic", (req, res) => {
    const dataRes = query();
    res.send({
        code: 200, // 0 表示处理成功，1 表示处理失败
        message: "数据信息查看成功！", // 状态的描述
        data: dataRes, // 需要响应给客户端的数据
    });
});
export default queryDataListDynamic;
